package com.hongning.railway.ui.main.fragments.cadremanagement;

import android.arch.lifecycle.ViewModelProviders;
import android.databinding.ObservableField;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hongning.railway.BR;
import com.hongning.railway.R;
import com.hongning.railway.app.AppViewModelFactory;
import com.hongning.railway.databinding.ActivityAboutBinding;
import com.hongning.railway.databinding.FragmentCadremanagementrosterInfoBinding;
import com.hongning.railway.entity.reqbean.RosterBean;
import com.hongning.railway.entity.reqbean.ThreesessionSanDoneLessonBean;
import com.hongning.railway.ui.main.fragments.cadremanagement.viewmodel.CadreManagementRosterInfoViewModel;
import com.hongning.railway.ui.main.fragments.threesessionsandonelesson.ThreesessionSanDoneLessonFragmentInfo;

import me.goldze.mvvmhabit.base.BaseActivity;
import me.goldze.mvvmhabit.base.BaseFragment;
import me.goldze.mvvmhabit.base.BaseViewModel;

public class CadreManagementRosterInfoFragment extends BaseFragment<FragmentCadremanagementrosterInfoBinding, CadreManagementRosterInfoViewModel> {

    public static CadreManagementRosterInfoFragment newInstance() {
        Bundle args = new Bundle();
        CadreManagementRosterInfoFragment fragment = new CadreManagementRosterInfoFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_cadremanagementroster_info;
    }

    @Override
    public int initVariableId() {
        return BR.viewModelRosterInfo;
    }
    @Override
    public CadreManagementRosterInfoViewModel initViewModel() {
        AppViewModelFactory appViewModelFactory = AppViewModelFactory.getInstance(getActivity().getApplication());
        return ViewModelProviders.of(this,appViewModelFactory).get(CadreManagementRosterInfoViewModel.class);
    }
    @Override
    public void initData() {
        super.initData();
        binding.appTitle.ivLeft.setVisibility(View.VISIBLE);
        binding.appTitle.ivLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getActivity().finish();
            }
        });
        binding.appTitle.tvTopTitle.setText("干部详情");
        RosterBean    dataBean = (RosterBean)getArguments().getSerializable("RosterBean");
        viewModel.setData(dataBean);
    }
}
